Author

Adam Kong

Code
library(tidyverse)
── Attaching packages ─────────────────────────────────────── tidyverse 1.3.2 ──
✔ ggplot2 3.4.0      ✔ purrr   1.0.0 
✔ tibble  3.1.8      ✔ dplyr   1.0.10
✔ tidyr   1.2.1      ✔ stringr 1.5.0 
✔ readr   2.1.3      ✔ forcats 0.5.2 
── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
✖ dplyr::filter() masks stats::filter()
✖ dplyr::lag()    masks stats::lag()
Code
library(palmerpenguins)
Code
ugly <- ggplot(data = penguins) + 
  geom_point(mapping = aes(x = bill_length_mm, y = bill_depth_mm, color = species, shape = island, size = year, alpha = body_mass_g)) +
  labs(x = "BiLL lenGtH(mM0)", y = "bIlL leNgTh9(mm))") + 
  scale_shape_manual(values = c(9, 16, 19)) + 
  theme_light() +
  geom_smooth(mapping = aes(x = bill_length_mm, y = bill_depth_mm, color = island))

ugly + theme(
  panel.background = element_rect(fill = "#7B3F00", size = 5)) +
  theme(plot.background = element_rect(fill = "#FFFF00", size = 0.1))
Warning: The `size` argument of `element_rect()` is deprecated as of ggplot2 3.4.0.
ℹ Please use the `linewidth` argument instead.
`geom_smooth()` using method = 'loess' and formula = 'y ~ x'
Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
Warning: Removed 2 rows containing missing values (`geom_point()`).

Code
set.seed(417)
library(plotly)

Attaching package: 'plotly'
The following object is masked from 'package:ggplot2':

    last_plot
The following object is masked from 'package:stats':

    filter
The following object is masked from 'package:graphics':

    layout
Code
temp <- penguins[,4]
pressure <- rnorm(100)
dtime <- 1:100
Code
plot_ly(x=temp, y=pressure, z=dtime, type="scatter3d", mode="markers")